<template>
  <div>
    <button @click="Str = 'UserName'">点击显示陈伟霆</button>
    <button @click="Str = 'UserInfo'">点击显示动态组件</button>
    <div>
      <component :is="Str"></component>
    </div>
  </div>
</template>

<script>
import UserName from "./components/User/UserName.vue";
import UserInfo from "./components/User/UserInfo.vue";
export default {
  data() {
    return {
      Str: "UserName",
    };
  },
  components: {
    UserName,
    UserInfo,
  },
};
</script>

<style>
</style>